from cyaron import *

#predata
name = "map"
mxf = 0
mxn = 0

for i in range(1, 11):
    test_data = IO(file_prefix=name, data_id=i)
    # make data
    if i < 6:
        mxf = 5
        mxn = 5
    elif i < 9:
        mxf = 30
        mxn = 100
    else :
        mxf = 100
        mxn = 500
    f = randint(0, mxf)
    test_data.input_writeln(f)

    if f!= 0:
        for i in range(f):
            n = randint(1, mxn)
            m = randint(1, 2*mxn)
            w = randint(1, 2*mxn)

            graph1 = Graph.graph(n, m, weight_limit=mxn)
            # graph2 = Graph.DAG(n, w, weight_limit=mxn, loop=True)
            graph2 = Graph.graph(n, w, weight_limit=mxn)
            
            test_data.input_writeln(n, m, w)
            test_data.input_writeln(graph1)
            test_data.input_writeln(graph2)
    
    # run data by shell
    test_data.output_gen("./"+name)